package cn.gson.boot.controller;

import cn.gson.boot.model.pojos.Dept;
import cn.gson.boot.model.pojos.Role;
import cn.gson.boot.model.pojos.Sort;
import cn.gson.boot.model.pojos.User;
import cn.gson.boot.model.service.DeptSortService;
import cn.gson.boot.model.service.EmpRoleService;
import cn.gson.boot.model.service.EmpService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("ds")
public class DeptSortController {
    @Autowired
    DeptSortService deptSortService;

    @RequestMapping("/selectAllSort")
    @ResponseBody
    public List<Sort> selectAllSort(){
        return deptSortService.selectAllSort();
    }

    @RequestMapping("/selectdeptSortByDeptId")
    @ResponseBody
    //根据部门id查看功能组
    public List<Integer> selectdeptSortByDeptId(Integer deptId){
        return deptSortService.selectdeptSortByDeptId(deptId);
    }

    @RequestMapping("/selectdeptSortByDeptId2")
    @ResponseBody
    //根据部门id查看功能组
    public List<Sort> selectdeptSortByDeptId2(Integer deptId){
        return deptSortService.selectdeptSortByDeptId2(deptId);
    }


    //修改部门下的功能组
    @RequestMapping("saveDeptSort")
    @ResponseBody
    public void saveDeptSort(Integer deptId,String jsList2){
        deptSortService.saveDeptSort(deptId,jsList2);
    }

}
